<%@ Page Language="C#" Theme="Defaultsys" AutoEventWireup="true" CodeFile="NumberCallsWeek.aspx.cs"
    Inherits="NumberCallsWeek" Title="Rapport Plan System - Number calls week" MasterPageFile="~/MasterPage.master" %>

<%@ MasterType VirtualPath="~/MasterPage.master" %>
<asp:Content runat="server" ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1">

    <script type="text/javascript">   
    
     function ValidateSymbols(oSrc, args)
        {
            args.IsValid = true;
            str = args.Value;
            for (i=0; i<str.length; i++ )
            { 
                if ((str.charAt(i) < '0') || (str.charAt(i) > '9'))
                    args.IsValid = false;
            }
        } 
    
    </script>

    <table border="0" width="100%" cellpadding="0" cellspacing="0">
        <tr>
            <td class="contTable">
                <asp:GridView ID="grdUsers" SkinID="gvGrid" runat="server" AutoGenerateColumns="false"
                    DataKeyNames="UserId" Width="100%">
                    <Columns>
                        <asp:TemplateField HeaderText="ID" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center"
                             HeaderStyle-Width="3%">
                            <ItemTemplate>
                                <%# Container.DataItemIndex + 1 %>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:BoundField HeaderText="User" DataField="ConnectName" 
                            HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left" />
                            
                        <asp:TemplateField HeaderText="Max. number of calls" 
                            HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="Left">
                            <ItemTemplate>
                                <asp:TextBox ID="MaxCallPerWeek" runat="server" Text='<%# Eval("MaxCallPerWeek") %>'></asp:TextBox>
                                <asp:CustomValidator ID="CustomValidator6" runat="server" ClientValidationFunction="ValidateSymbols"
                                    ControlToValidate="MaxCallPerWeek" Display="Dynamic" ErrorMessage="*" SetFocusOnError="True"></asp:CustomValidator>
                            </ItemTemplate>
                        </asp:TemplateField>
                        
                        <asp:TemplateField HeaderText="Id" Visible="false">
                            <ItemTemplate>
                                <asp:TextBox ID="id" runat="server" Text='<%# Eval("UserId") %>' Visible="false"></asp:TextBox>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        There are currently no users with number calls per week.</EmptyDataTemplate>
                </asp:GridView>
                <asp:Button ID="btnSave" runat="server" OnClick="Save" Text="Save" />
                <br />
                <asp:Label ID="lblSavedCalls" runat="server" ForeColor="#FF8000" Text="The maximum number of call for each user was saved"
                    Visible="False"></asp:Label></td>
        </tr>
    </table>
</asp:Content>
